package drafthj.javase.concurrent.completableFuture;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

/**
 * 〈一句话功能简述〉
 * 〈功能详细描述〉
 *
 * @author drafthj
 * @date 2021/7/20
 * @see [相关类/方法]（可选）
 * @since [产品/模块版本] （可选）
 */
public class ThenApplyTest {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        CompletableFuture<Integer> completableFuture = CompletableFuture.completedFuture(1);
        CompletableFuture<Integer> result = completableFuture.thenApply((t) -> t + 1);
        System.out.println(result.get());
    }
}
